package com.candykingdom.model
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	[Event(name="pageName", type="com.candykingdom.model.PageModel")]
	[Event(name="pageHome", type="com.candykingdom.model.PageModel")]
	[Event(name="pageBack", type="com.candykingdom.model.PageModel")]
	
	public class PageModel extends EventDispatcher
	{
		public static const PAGE_NAME:String = "pageName";
		public static const PAGE_HOME:String = "pageHome";
		public static const PAGE_BACK:String = "pageBack";
		
		private var _pageName:String;
		
		public function PageModel(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		/** 指定页名称 */
		public function get pageName():String {return _pageName;}
		public function set pageName(value:String):void
		{
			_pageName = value;
			dispatchEvent(new Event(PAGE_NAME));
		}
		
		/** 返回上一页 */
		public function pageBack():void
		{
			dispatchEvent(new Event(PAGE_HOME));
		}
		
		/** 返回首页事件 */
		public function pageHome():void
		{
			dispatchEvent(new Event(PAGE_BACK));
		}
	}
}